import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type Result = {
  success: boolean;
  data: Array<any>;
};

/** 文件上传 */
export const formUpload = data => {
  return http.request<Result>(
    "post",
    baseUrlApi("pfmea_file_manage/upload_pfmea_file/"),
    {
      data
    },
    {
      headers: {
        "Content-Type": "multipart/form-data"
      }
    }
  );
};

/** 批量删除数据 */
export const deleteZoneData = data => {
  return http.request<Result>(
    "post",
    baseUrlApi("pfmea_file_manage/delete_pfmea_zone_data/"),
    {
      data
    },
    {
      headers: {
        "Content-Type": "multipart/form-data"
      }
    }
  );
};
